<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML>
<html>
<head>
<title>'addnewchacter.jsp'</title>
<style type="text/css">
#content {
	width: 800px;
	min-height: 120px;
	max-height: 600px;
	_height: 120px;
	margin-left: auto;
	margin-right: auto;
	padding: 3px;
	outline: 0;
	border: 1px solid #a0b3d6;
	font-size: 12px;
	word-wrap: break-word;
	overflow-x: hidden;
	overflow-y: auto;
	_overflow-y: visible;
}
</style>

<script type="text/javascript">
function submitChacter(){
var content = document.getElementById("content").innerHTML;
var nid = document.getElementById("nid").value;
var num = document.getElementById("num").value;
var title = document.getElementById("title").value;

var url = "${pageContext.request.contextPath }/author/SaveAChacter";
var method ="POST";
var param1 = "&nid="+nid+"&num="+num+"&title="+title+"&modify=create";
var params="content="+encodeURIComponent(content)+param1;//uri编码
var tgel = "tips";
toDoXHR(url,method,params,tgel);

}
</script>
<script type="text/javascript" src="${pageContext.request.contextPath }/JS/toDoXHR.js"></script>
</head>

<body>
	<div align="center">
		<h3 align="center">编写最新一章节</h3>
		<input type="hidden" id="nid"value="${novel.id }">
		<table>
			<tr>
				<td>小说名称</td>
				<td>${novel.name }</td>
			</tr>
			<tr>
				<td>章节编号</td>
				<td ><input type="text" id="num" readonly="readonly" value="${num }"></td>
			</tr>
			<tr>
				<td>章节名</td>
				<td><input type="text" id="title">
				</td>
			</tr>
		</table>
	</div>
	<div id="content" contenteditable="plaintext-only"></div>
	<div align="center"><input type="button" value="确认提交" onclick="submitChacter()"/></div>
	<div  align="center" id="tips"></div>
</body>
</html>
